package vn.demand.dragon.controller
{
	import com.salesbuilder.control.TabManager;
	
	import mx.core.Container;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	import vn.demand.dragon.model.ReferenceProxy;
	import vn.demand.dragon.view.ReferenceOperatorListMediator;
	
	public class CloseReferenceOperatorListCommand extends SimpleCommand
	{
		override public function execute( note:INotification ) :void    
		{
			var tab:Container = note.getBody() as Container;
			if (tab == null) return;
			if (facade.hasMediator(ReferenceOperatorListMediator.NAME)) {
				facade.removeMediator(ReferenceOperatorListMediator.NAME);
			}
			if (facade.hasProxy(ReferenceProxy.NAME)) {
				facade.removeProxy(ReferenceProxy.NAME)
			}			
			TabManager.removeTab(tab);
        }
	}
}